package com.firebird.oms.domain.sm;

// Generated 2009-11-18 13:23:50 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * TismStaff generated by hbm2java
 */
@Entity
@Table(name = "tism_staff")
public class TismStaff implements java.io.Serializable,Comparable<TismStaff> {

	private static final long serialVersionUID = -474615516933006539L;
	private Integer staffId;
	private Integer upperStaffId;
	private String staffName;
	private Integer sex;
	private Integer placeId;
	private String placeName;
	private Integer age;
	private Date birthday;
	private String cardNo;
	private Integer companyId;
	private String companyName;
	private Integer departId;
	private String departName;//片区
	private String relaPhone;
	private String relaMobile;
	private String faxPhone;
	private String otherRelaPhone;
	private String relaAddr;
	private String email;
	private Integer state;

	public TismStaff() {
	}

	public TismStaff(String staffName, Integer companyId) {
		this.staffName = staffName;
		this.companyId = companyId;
	}

	public TismStaff(Integer upperStaffId, String staffName, Integer sex,
			Integer placeId, Integer age, Date birthday, String cardNo,
			Integer companyId, Integer departId, String relaPhone,
			String relaMobile, String faxPhone, String otherRelaPhone,
			String relaAddr, String email, Integer state) {
		this.upperStaffId = upperStaffId;
		this.staffName = staffName;
		this.sex = sex;
		this.placeId = placeId;
		this.age = age;
		this.birthday = birthday;
		this.cardNo = cardNo;
		this.companyId = companyId;
		this.departId = departId;
		this.relaPhone = relaPhone;
		this.relaMobile = relaMobile;
		this.faxPhone = faxPhone;
		this.otherRelaPhone = otherRelaPhone;
		this.relaAddr = relaAddr;
		this.email = email;
		this.state = state;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "staff_id", unique = true, nullable = false)
	public Integer getStaffId() {
		return this.staffId;
	}

	public void setStaffId(Integer staffId) {
		this.staffId = staffId;
	}

	@Column(name = "upper_staff_id")
	public Integer getUpperStaffId() {
		return this.upperStaffId;
	}

	public void setUpperStaffId(Integer upperStaffId) {
		this.upperStaffId = upperStaffId;
	}

	@Column(name = "staff_name", nullable = false, length = 64)
	public String getStaffName() {
		return this.staffName;
	}

	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}

	@Column(name = "sex")
	public Integer getSex() {
		return this.sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	@Column(name = "place_id")
	public Integer getPlaceId() {
		return this.placeId;
	}

	public void setPlaceId(Integer placeId) {
		this.placeId = placeId;
	}
	
	@Transient
	public String getPlaceName() {
		return placeName;
	}

	public void setPlaceName(String placeName) {
		this.placeName = placeName;
	}

	@Column(name = "age")
	public Integer getAge() {
		return this.age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birthday", length = 0)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "card_no", length = 32)
	public String getCardNo() {
		return this.cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	@Column(name = "company_id", nullable = false, precision = 9, scale = 0)
	public Integer getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}
	
	@Transient
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "depart_id", precision = 9, scale = 0)
	public Integer getDepartId() {
		return this.departId;
	}

	public void setDepartId(Integer departId) {
		this.departId = departId;
	}

	@Transient
	public String getDepartName() {
		return departName;
	}

	public void setDepartName(String departName) {
		this.departName = departName;
	}

	@Column(name = "rela_phone", length = 24)
	public String getRelaPhone() {
		return this.relaPhone;
	}

	public void setRelaPhone(String relaPhone) {
		this.relaPhone = relaPhone;
	}

	@Column(name = "rela_mobile", length = 24)
	public String getRelaMobile() {
		return this.relaMobile;
	}

	public void setRelaMobile(String relaMobile) {
		this.relaMobile = relaMobile;
	}

	@Column(name = "fax_phone", length = 24)
	public String getFaxPhone() {
		return this.faxPhone;
	}

	public void setFaxPhone(String faxPhone) {
		this.faxPhone = faxPhone;
	}

	@Column(name = "other_rela_phone", length = 24)
	public String getOtherRelaPhone() {
		return this.otherRelaPhone;
	}

	public void setOtherRelaPhone(String otherRelaPhone) {
		this.otherRelaPhone = otherRelaPhone;
	}

	@Column(name = "rela_addr", length = 120)
	public String getRelaAddr() {
		return this.relaAddr;
	}

	public void setRelaAddr(String relaAddr) {
		this.relaAddr = relaAddr;
	}

	@Column(name = "email", length = 48)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof TismStaff))
			return false;
		TismStaff castOther = (TismStaff) other;
		return new EqualsBuilder().append(staffId, castOther.staffId).append(
				upperStaffId, castOther.upperStaffId).append(staffName,
				castOther.staffName).append(sex, castOther.sex).append(placeId,
				castOther.placeId).append(age, castOther.age).append(birthday,
				castOther.birthday).append(cardNo, castOther.cardNo).append(
				companyId, castOther.companyId).append(departId,
				castOther.departId).append(relaPhone, castOther.relaPhone)
				.append(relaMobile, castOther.relaMobile).append(faxPhone,
						castOther.faxPhone).append(otherRelaPhone,
						castOther.otherRelaPhone).append(relaAddr,
						castOther.relaAddr).append(email, castOther.email)
				.append(state, castOther.state).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(staffId).append(upperStaffId)
				.append(staffName).append(sex).append(placeId).append(age)
				.append(birthday).append(cardNo).append(companyId).append(
						departId).append(relaPhone).append(relaMobile).append(
						faxPhone).append(otherRelaPhone).append(relaAddr)
				.append(email).append(state).toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("staffId", staffId).append(
				"upperStaffId", upperStaffId).append("staffName", staffName)
				.append("sex", sex).append("placeId", placeId).append("age",
						age).append("birthday", birthday).append("cardNo",
						cardNo).append("companyId", companyId).append(
						"departId", departId).append("relaPhone", relaPhone)
				.append("relaMobile", relaMobile).append("faxPhone", faxPhone)
				.append("otherRelaPhone", otherRelaPhone).append("relaAddr",
						relaAddr).append("email", email).append("state", state)
				.toString();
	}

	public int compareTo(TismStaff o) {
		return this.upperStaffId.compareTo(o.upperStaffId);
	}

}
